/*  This file is part of -_-.

    -_- is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    -_- is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with -_-.  If not, see <http://www.gnu.org/licenses/>.

    Copyright 2012-2013 Oliver Katz */

#ifndef __OPAL_STD_SUBPROCESS_H
#define __OPAL_STD_SUBPROCESS_H

#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>

int z_subprocess_spawn_sync(char **args); //method: spawn a process and wait for it to be complete
//returnof z_subprocess_spawn_sync: int: exit code of process
int z_subprocess_spawn_async(char **args); //method: spawn a process and immediately continue execution without waiting for it to be complete
//returnof z_subprocess_spawn_async: int: pid of process
int z_subprocess_spawn_async_redirect(char **args); //method: spawn a process with IO redirection and immediately continue execution without waiting for it to be complete
//returnof z_subprocess_spawn_async_redirect: int: pid of process
int z_subprocess_wait(int pid); //method: wait for subprocess with pid 'pid' to be complete
//returnof z_subprocess_wait: int: exit code of process

#endif